package routers

import (
	"findme-api/controllers"
	"github.com/astaxie/beego"
	//"github.com/astaxie/beego/plugins/cors"
)

func init() {

	//beego.Router("/", &controllers.MainController{})
	//beego.NSNamespace("/*",
		//Options用于跨域复杂请求预检
		beego.Router("/*", &controllers.MainController{}, "options:Options")
	//)
	beego.Router("/api/getdata", &controllers.MainController{}, "get:GetData")
	beego.Router("/ws", &controllers.MyWebSocketController{},"get:GetWebsocket")
	beego.Router("/api/login", &controllers.UserController{},"post:Login")
	beego.Router("/api/registercompany", &controllers.UserController{},"post:Registercompany")
	beego.Router("/api/registersuper", &controllers.UserController{},"post:Registersuper")
	beego.Router("/api/registeruser", &controllers.UserController{},"post:Registeruser")
	beego.Router("/api/showalluserinfo", &controllers.UserController{},"get:ShowalluserInfo")
	beego.Router("/api/deleteuserinfo", &controllers.UserController{},"post:DeleteuserInfo")
	beego.Router("/api/edituserinfo", &controllers.UserController{},"post:Edituserinfo")
	beego.Router("/api/queryorbitbyid", &controllers.QueryGpsController{}, "get:QueryOrbitById")
	beego.Router("/api/addfence", &controllers.FenceController{}, "post:Addfence")
	beego.Router("/api/queryalllabel", &controllers.QueryLabelController{}, "get:QueryAllLabel")
	beego.Router("/api/searchlabel", &controllers.QueryLabelController{}, "get:SearchLabel")
	beego.Router("/api/searchalarm", &controllers.AlarmController{}, "post:SearchAlarm")
	beego.Router("/api/changelabel", &controllers.QueryLabelController{}, "post:ChangeLabelById")
	beego.Router("/api/changecap", &controllers.QueryLabelController{}, "post:ChangeCapById")
	beego.Router("/api/changecamera", &controllers.QueryLabelController{}, "post:ChangeCameraById")
	beego.Router("/api/deletelabel", &controllers.QueryLabelController{}, "post:DeleteLabelById")
	beego.Router("/api/alarmgroup", &controllers.QueryLabelController{}, "post:AlarmgroupById")
	beego.Router("/api/searchbycondition", &controllers.QueryLabelController{}, "get:SearchByCondition")
	beego.Router("/api/queryfence",&controllers.FenceController{},"get:Queryfence")
	beego.Router("/api/loadonefence",&controllers.FenceController{},"get:LoadOneFence")
	beego.Router("/api/loadallfence",&controllers.FenceController{},"get:LoadALLFence")
	beego.Router("/api/changefence", &controllers.FenceController{}, "post:ChangeFenceById")
	beego.Router("/api/deletefence", &controllers.FenceController{}, "post:DeleteFenceById")
	beego.Router("/api/readpeoplealarm", &controllers.AlarmController{}, "get:ReadpeopleAlarm")
	beego.Router("/api/readequipmentalarm", &controllers.AlarmController{}, "get:ReadequipmentAlarm")
	beego.Router("/api/queryalarm", &controllers.AlarmController{}, "get:Queryalarm")
	beego.Router("/api/resettoredis", &controllers.AlarmController{}, "post:Resettoredis")
}


